import React, { Component } from 'react'

export default class App extends Component {
  register=()=>{
    console.log('姓名:',this.nameInput.value);
    console.log('密码:',this.pwdInput.value);
  }
  render() {
    return (
      <div>
        <div>
          <label htmlFor="uname">姓名:</label>
          <input type="text" id='uname' placeholder='请输入姓名' ref={input=>this.nameInput=input}/>
        </div>
        <div>
          <label htmlFor="pwd">密码:</label>
          <input type="text" id='pwd' placeholder='请输入姓名' ref={input=>this.pwdInput=input}/>
        </div>
        <div>
          <button onClick={this.register}>注册</button>
        </div>
      </div>
    )
  }
}
